# pragma once
# include <map>
# include <stack>
# include <ostream>

namespace ZDSJ
{
    class XmlItem;
    # define FILE_SIZE 1500
    class XmlObject{
    public:
        XmlObject(const char* _file_name);
        void showXmlTree(std::ostream& _out);
        const XmlItem* root() const;
        ~XmlObject();
    private:
        XmlItem* m_root;
        void loadFile(const char* _file_name);
        bool dealBuffer(const char* _buffer, size_t _size, std::stack<XmlItem*>& _queue);
        XmlItem* findTag(const char* _buffer, size_t _size, size_t& _index);
        void showXmlTree(std::ostream& _out, const XmlItem* _node, short level);
    };
}
